export default {
  get(url, options = {}) {
    return this.request({
      method: 'GET',
      data: options.params || {},
      url,
      header: {
       "accept": "application/json"
      }
    })
  },
  post(url, data = {}) {
    return this.request({
      method: 'POST',
      data,
      url,
      header: {
       "accept": "application/json"
      }
    })
  },
  delete(url, data = {}) {
    return this.request({
      method: 'DELETE',
      data,
      url,
      header: {
       "accept": "application/json"
      }
    })
  },
  request(obj) {
    return new Promise((resolve, reject) => {
      wx.request({...obj, success: resolve, fail: reject})
    })
  }
}